// 优惠类，优惠类型
class Promotion {
    constructor(promotionId, promotionType, promotionName, promotionRule) {
        // 字符串，promotion1
        this.promotionId = promotionId
        // 字符串，英文
        this.promotionType = promotionType
        // 字符串，汉字
        this.promotionName = promotionName
        // 函数，优惠规则
        this.promotionRule = promotionRule
    }

    static addPromotion(promotionList, promotion) {
        promotionList[promotion.promotionId] = promotion
    }

    change(type, s) {
        // type, s 都是字符串
        this[type] = s
    }

    changeRule(func) {
        this.promotionRule = func
    }

}